import $store from '@/store/index.js';
import msgSqlite from "@/sqlite_services/msg.js"
//群消息审核
const handle = async(data)=>{
	try{
		await msgSqlite.updateMessageById(data.msg_id, {
			is_review: data.req_status,
		})
		const activeChatUuid = $store.state.chat.chatInfo && $store.state.chat.chatInfo.uuid || ''; // 访问根级状态的chatInfo
		
		if(data.target_id == activeChatUuid){
			uni.$emit('onMessageControls', {
				type:'group_auditing',
				data:{
					msg_id: data.msg_id,
					req_status: data.req_status
				}
			})
		}
	}catch(e){
		
	}
}
export default handle